<template>
	<view class="page">
		<u-navbar title="期刊图片" :auto-back="true">
			<view class="u-nav-slot" slot="right">
				<view class="nav-right" @click="openPopUp">
					<u-icon name="search" size="24" color="#376CB4"></u-icon>
					<u-icon name="list" size="24" style="margin-left: 20rpx;" color="#376CB4"></u-icon>
				</view>
			</view>
		</u-navbar>
		<view class="ll"></view>
		<view class="jou-content-3">
			<view class="jou-content-3-item" v-for="(item,index) in rst" @click="gotoDetail(item)">
				<image :src="item.photo" mode="aspectFit"  class="jou-content-3-item-img"></image>
				<view class="jou-content-3-item-title font-28">{{item.title}}</view>
			</view>
		</view>

		<Footer></Footer>
		<u-back-top :scroll-top="scrollTop" bottom="20" icon="arrow-up" right="10"
			:iconStyle="{color:'#2979ff'}"></u-back-top>
		<!-- 首页弹框 -->
		<CommonTk ref="commonTk"></CommonTk>
	</view>
</template>

<script>
	import Footer from '@/components/Footer.vue'
	import CommonTk from '@/components/CommonTk.vue'
	import {
		api,
		BaseImgUrl,
		http
	} from '@/config/common.js'
	export default {
		data() {
			return {
				page: 1,
				total_page: 1,
				rst: []
			}
		},
		components: {
			Footer,
			CommonTk
		},
		filters: {},
		mounted() {},
		onLoad(e) {
			this.getQkDt()
		},
		onShow() {},
		beforeDestroy() {},
		onPageScroll(e) {},
		onReachBottom() {
			if (this.page < this.total_page) {
				this.page = this.page + 1
				this.getQkDt()
			} else {
				console.log('no more')
			}
		},
		methods: {
			openPopUp() {
				this.$refs.commonTk.openShow()
			},
			gotoDetail(item){
				if (item.glqs_id && item.glqstr) {
					uni.navigateTo({
						url:'/pages/journal_introduction/list?id='+item.glqs_id+'&str='+item.glqstr
					})
				}
			},
			getQkDt() {
				api.post('api/index/columns', {
					id: 372,
					page: this.page,
					pageSize: 15
				}).then(res => {
					let rst = res.data
					if (rst.code == 1) {
						let result = rst.data 
						this.total_page = result.last_page
						let temp_rst = result.data;
						
						temp_rst.forEach(function(item, index) {
							temp_rst[index]['photo'] = BaseImgUrl + 'upfile/' + item.photo
						});
						
						this.rst = this.rst.concat(temp_rst)
					}
				}).catch(err => {})
			}, 
		}
	};
</script>

<style scoped>
	.ll {
		height: 90rpx;
	}

	.jou-content-3 {
		width: 690rpx;
		margin: 0 auto;
		margin-top: 30rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
	}

	.jou-content-3-item {
		width: 335rpx;
		margin-bottom: 20rpx;
		text-align: center;
	}

	.jou-content-3-item-img {
		/* width: 326rpx;
		height: 456rpx; */
		width: 280rpx;
		height: 380rpx; 
	}

	.jou-content-3-item-title {
		margin-top: 5rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap; 
		text-align: center;  
	}

	.jou-content-2-item-title-list-title-active {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #376DB5;
		width: 122rpx;
		height: 48rpx;
		background: #FFFFFF;
		border: 1px solid #376DB5 !important;
		border-radius: 4rpx;
	}

	.jou-content-2-item-title-list {
		display: flex;
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		margin-left: 10rpx;
	}

	.jou-content-2-item-title-list-title {
		width: 122rpx;
		height: 48rpx;
		background: #FFFFFF;
		border: 1px solid #CCCCCC;
		border-radius: 4rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		margin-left: 20rpx;
		margin-top: 20rpx;
	}

	.jou-content-2-item-title {
		width: 186rpx;
		height: 66rpx;
		background: #FFFFFF;
		border: 1px solid #376DB5;
		border-radius: 4rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #376DB5;
		margin-bottom: 5rpx;
		margin-left: 30rpx;
	}

	.jou-content-2-item {
		margin-bottom: 30rpx;
	}

	.jou-content-2 {
		/* width: 690rpx; */
		margin: 0 auto;
		margin-top: 30rpx;
	}

	.jou-content-1 {
		width: 690rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}

	.jou-nav-item-active {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #376DB5;
		border-bottom: 2rpx solid #376DB5;
	}

	.jou-nav-item {
		height: 90rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.jou-nav {
		width: 690rpx;
		margin: 0 auto;
		border-bottom: 2rpx solid #E6E6E6;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-top: 100rpx;
	}

	::v-deep .u-navbar__content {
		width: 750rpx;
		height: 88rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 2rpx 14rpx 0rpx rgba(4, 0, 0, 0.14);
	}

	.nav-right {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.logo {
		width: 306rpx !important;
		height: 55rpx !important;
	}

	page {
		background: #fff;
	}
</style>